<?php if (!defined('BASEPATH')) exit('No direct script access allowed');

class MY_Input extends CI_Input {
	/**
	 * Constructor
	 */
	var $get = array();

	function MY_Input(){
		parent::CI_Input();

		$this->_set_get_array();
	}

	/**
	 * Creates a new $_GET for the methods get and get_post
	 * @return void
	 */
	function _set_get_array(){
		$getstring = substr($_SERVER[ 'REQUEST_URI'  ], strpos($_SERVER[ 'REQUEST_URI'  ],'?') + 1 );
		$get_pairs = explode('&',$getstring);
		foreach ($get_pairs as $getparam){
			$this->get[ substr($getparam,0,strpos($getparam, '=')) ] = substr($getparam,strpos($getparam, '=')+1);
		}
	}

	/**
	* Fetch an item from the GET array
	*
	* @access	public
	* @param	string
	* @param	bool
	* @return	string
	*/
	function get($index = '', $xss_clean = FALSE)
	{
		return $this->_fetch_from_array($this->get, $index, $xss_clean);
	}
}
/* end of file */